 #include <stdio.h> 
 #include <stdlib.h>
 
  int main(void)
  {
  	int i = 0;
  	char buffer[1024] = {0};
  	char path[32] = "";
  	FILE* fp1 = NULL,*fp2 = NULL;
  	fp2 = fopen("F:/GIT/MY/Bad_Apple_Stm32_OLED/c/0.bin","wh");
  	if(NULL == fp2)
  	{
  		fprintf(stderr,"Can't creat 0.biin\n");
  		exit(EXIT_FAILURE);
	}
	for (i = 0;i< 65564;i++)
	{
		path[9] = i/10000 		+'0';
		path[10] = (i/1000)%10 	+'0';
		path[11] = (i/100)%10 	+'0';
		path[12] = (i/10)%10	+'0';
		path[13] = i%10			+'0';
		fp1 = fopen(path,"rb");
		if(NULL == fp1)
		{
			fprintf(stderr,"Can't open %s\n",path);
			exit(EXIT_FAILURE);
		}
		if(0 == i%1000) printf("%d",i);
		fread(buffer,1,1024,fp1);
		fwrite(buffer,1,1024,fp2);
		fclose(fp1);
		
	}  
	fclose(fp2);
	return 0;
  }
